package com.gee.spring.boot.starter.opengemini.core.annotation;

import io.opengemini.client.api.Precision;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import static com.gee.spring.boot.starter.opengemini.core.constant.StrConstant.EMPTY;

/**
 * @author gepengjun
 * @since 2024/4/29 17:27
 */
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
public @interface Measurement {

    String measurement();

    //当measurementSuffixField或measurementSuffixField字段的值为空时,返回measurement(), 否则返回measurement() + "_" + measurementSuffixField字段的值
    String[] measurementSuffixFields() default {};

    String database();

    String databaseSuffixField() default EMPTY;

    String retentionPolicy() default "autogen";

    Precision precision() default Precision.PRECISIONNANOSECOND;
}
